<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="../../css/bootstrap-combined.min.css">
    <link rel="stylesheet" href="../../css/layoutit.css">
    <script src="../../js/jquery-2.0.0.min.js"></script>
    <script type="text/javascript">
        function login() {
            var userid=$("#userid");
            var password=$("#password");

            if(userid.val() ==""){
                alert("账号不能为空")
                return;
            }
            if(password.val() ==""){
                alert("密码不能为空")
                return;
            }
            $.ajax({
                type: "POST",
                url: "loginmgr",
                data: $("#loginform").serialize(),
                success: function(msg){
                    if(msg == "error"){
                        alert("此账号已存在，请重新注册");
                    }else{
                        window.location.href="index";
                    }
                }
            });
        }
</script>
</head>
<body>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12">
            <form class="form-horizontal" id="loginform">
                <div class="control-group">
                    <label class="control-label" for="userid">账号</label>
                    <div class="controls">
                        <input id="userid" name="userid" type="text" />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="password">密码</label>
                    <div class="controls">
                        <input id="password" name="password" type="password" />
                    </div>
                </div>
                <div class="control-group">
                    <div class="controls">
                     <button class="btn" type="button" onclick="login()">登陆</button>&nbsp;
                        <a href="registr">注册</a>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

</body>
</html>